class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.o: E = None
        self.p: C = None
        self.v: B = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: B = None
        self.z: E = None
        self.w: F = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

l.t = j
l.o = j
l.r = n
l.p = f
l.v = h
l.x = e
n.q = l
n.s = l
n.p = h
n.z = b
n.w = d
f.v = b
f.q = b
e.o = f
e.r = n
j.u = d
d.p = e
h.q = l
h.s = l
h.p = n
h.z = b
h.w = d
b.u = d
assert e.o.q.u.p.o.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.o: E = None
        self.p: C = None
        self.v: B = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: B = None
        self.z: E = None
        self.w: F = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

l.t = j
l.o = j
l.r = n
l.p = f
l.v = h
l.x = e
n.q = l
n.s = l
n.p = h
n.z = b
n.w = d
f.v = b
f.q = b
e.o = f
e.r = n
j.u = d
d.p = e
h.q = l
h.s = l
h.p = n
h.z = b
h.w = d
b.u = d
assert e.o.q.u.p.o.v.u.txt == "d"