class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.w: B = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

f.r = c
f.z = j
f.w = j
f.y = d
b.y = h
b.s = d
b.x = c
h.z = b
g.s = a
g.p = h
g.u = d
l.v = d
l.q = d
l.o = d
d.v = l
d.p = l
j.y = h
j.s = d
j.x = f
a.y = h
a.s = d
a.x = c
c.r = f
c.z = b
c.w = j
c.y = d
assert b.y.z.y.z.x.z.txt == "b"