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

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

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

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

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

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

c = A("c")
d = B("d")
i = C("i")
j = D("j")
g = E("g")
a = F("a")
k = D("k")
f = C("f")

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

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

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

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

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

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

c = A("c")
d = B("d")
i = C("i")
j = D("j")
g = E("g")
a = F("a")
k = D("k")
f = C("f")

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