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

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

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

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

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

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

h = A("h")
g = B("g")
a = C("a")
j = D("j")
b = E("b")
l = F("l")
i = B("i")
k = B("k")

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

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

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

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

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

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

h = A("h")
g = B("g")
a = C("a")
j = D("j")
b = E("b")
l = F("l")
i = B("i")
k = B("k")

h.z = a
h.o = j
h.s = i
g.t = k
g.r = i
a.y = l
a.u = b
j.w = b
b.q = a
b.o = j
b.p = h
l.z = a
l.p = a
l.x = a
l.q = h
l.v = j
l.u = g
i.t = k
i.r = g
k.t = g
k.r = g
assert g.t.r.t.r.txt == "g"