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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.p: A = None
        self.q: D = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: A = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.p: C = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

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

g = A("g")
k = B("k")
d = C("d")
f = D("f")
l = E("l")
i = F("i")

g.t = l
g.x = d
k.w = d
k.z = d
k.y = f
k.q = f
k.p = g
d.s = g
d.t = f
f.u = d
f.p = g
f.o = l
f.z = l
l.v = d
l.s = d
l.p = d
l.w = k
l.o = i
i.p = d
assert l.s.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.p: A = None
        self.q: D = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: A = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.p: C = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

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

g = A("g")
k = B("k")
d = C("d")
f = D("f")
l = E("l")
i = F("i")

g.t = l
g.x = d
k.w = d
k.z = d
k.y = f
k.q = f
k.p = g
d.s = g
d.t = f
f.u = d
f.p = g
f.o = l
f.z = l
l.v = d
l.s = d
l.p = d
l.w = k
l.o = i
i.p = d
assert l.s.t.p.txt == "g"