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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.o: D = None
        self.y: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

d = A("d")
f = B("f")
l = C("l")
a = D("a")
e = E("e")
g = F("g")
i = E("i")
c = A("c")
j = D("j")

d.x = g
f.q = e
f.t = a
f.o = j
f.y = g
f.u = i
l.y = f
a.w = f
a.r = j
a.p = d
a.t = l
a.v = g
e.y = c
g.s = l
g.t = c
i.y = c
c.x = g
j.w = f
j.r = a
j.p = c
j.t = l
j.v = g
assert d.x.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.o: D = None
        self.y: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

d = A("d")
f = B("f")
l = C("l")
a = D("a")
e = E("e")
g = F("g")
i = E("i")
c = A("c")
j = D("j")

d.x = g
f.q = e
f.t = a
f.o = j
f.y = g
f.u = i
l.y = f
a.w = f
a.r = j
a.p = d
a.t = l
a.v = g
e.y = c
g.s = l
g.t = c
i.y = c
c.x = g
j.w = f
j.r = a
j.p = c
j.t = l
j.v = g
assert d.x.s.y.txt == "f"