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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.o: D = None
        self.x: A = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

h = A("h")
k = B("k")
c = C("c")
l = D("l")
g = E("g")
i = F("i")

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.o: D = None
        self.x: A = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

h = A("h")
k = B("k")
c = C("c")
l = D("l")
g = E("g")
i = F("i")

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