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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

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

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

b = A("b")
h = B("h")
k = C("k")
j = D("j")
c = E("c")
i = F("i")
f = A("f")
m = B("m")
g = F("g")
d = C("d")

b.y = k
h.o = b
h.t = m
h.y = m
h.z = g
h.v = j
k.x = b
k.q = j
j.y = b
c.u = j
c.s = j
c.r = i
i.u = d
i.w = b
f.y = d
m.o = b
m.t = h
m.y = h
m.z = g
m.v = j
g.u = d
g.w = b
d.x = f
d.q = j
assert b.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

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

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

b = A("b")
h = B("h")
k = C("k")
j = D("j")
c = E("c")
i = F("i")
f = A("f")
m = B("m")
g = F("g")
d = C("d")

b.y = k
h.o = b
h.t = m
h.y = m
h.z = g
h.v = j
k.x = b
k.q = j
j.y = b
c.u = j
c.s = j
c.r = i
i.u = d
i.w = b
f.y = d
m.o = b
m.t = h
m.y = h
m.z = g
m.v = j
g.u = d
g.w = b
d.x = f
d.q = j
assert b.y.x.y.txt == "k"