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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: C = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

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

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

j.v = c
j.t = c
j.q = b
j.u = h
b.y = a
b.s = a
b.q = d
b.p = d
a.w = c
a.o = h
d.u = b
e.p = j
e.y = j
e.x = j
e.u = a
h.t = j
f.y = a
f.s = a
f.q = d
f.p = d
c.p = j
c.y = j
c.x = j
c.u = a
n.y = a
n.s = a
n.q = d
n.p = d
assert d.u.q.u.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: E = None
        self.q: B = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: C = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

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

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

j.v = c
j.t = c
j.q = b
j.u = h
b.y = a
b.s = a
b.q = d
b.p = d
a.w = c
a.o = h
d.u = b
e.p = j
e.y = j
e.x = j
e.u = a
h.t = j
f.y = a
f.s = a
f.q = d
f.p = d
c.p = j
c.y = j
c.x = j
c.u = a
n.y = a
n.s = a
n.q = d
n.p = d
assert d.u.q.u.q.u.txt == "b"