class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: A = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.v: F = None
        self.s: D = None
        self.t: E = None
        self.txt = txt

d = A("d")
j = B("j")
a = C("a")
b = D("b")
l = E("l")
n = F("n")
k = B("k")
h = F("h")
c = C("c")
f = D("f")

d.v = j
j.v = h
j.t = d
a.r = n
a.y = d
a.o = b
b.r = k
b.s = k
l.w = d
l.o = d
l.t = d
l.u = j
n.u = j
n.w = h
n.v = h
n.s = b
n.t = l
k.v = h
k.t = d
h.u = j
h.w = n
h.v = n
h.s = b
h.t = l
c.r = n
c.y = d
c.o = b
f.r = j
f.s = j
assert n.u.v.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: A = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.v: F = None
        self.s: D = None
        self.t: E = None
        self.txt = txt

d = A("d")
j = B("j")
a = C("a")
b = D("b")
l = E("l")
n = F("n")
k = B("k")
h = F("h")
c = C("c")
f = D("f")

d.v = j
j.v = h
j.t = d
a.r = n
a.y = d
a.o = b
b.r = k
b.s = k
l.w = d
l.o = d
l.t = d
l.u = j
n.u = j
n.w = h
n.v = h
n.s = b
n.t = l
k.v = h
k.t = d
h.u = j
h.w = n
h.v = n
h.s = b
h.t = l
c.r = n
c.y = d
c.o = b
f.r = j
f.s = j
assert n.u.v.t.u.t.txt == "d"