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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: C = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: D = None
        self.x: C = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: C = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: D = None
        self.x: C = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

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