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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: A = None
        self.t: C = None
        self.r: A = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

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

g = A("g")
b = B("b")
i = C("i")
f = D("f")
n = E("n")
j = F("j")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: A = None
        self.t: C = None
        self.r: A = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

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

g = A("g")
b = B("b")
i = C("i")
f = D("f")
n = E("n")
j = F("j")

g.u = n
g.w = i
g.y = i
g.s = j
b.z = j
b.u = j
b.p = j
b.t = g
b.s = f
i.z = b
i.t = b
i.r = j
f.w = n
f.v = g
n.w = j
n.y = j
n.u = g
n.r = g
n.t = i
n.o = f
j.u = i
j.y = n
j.t = b
assert j.y.r.u.t.z.txt == "b"