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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: C = None
        self.w: D = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: C = None
        self.w: D = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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