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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

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

g = A("g")
m = B("m")
k = C("k")
j = D("j")
h = E("h")
i = F("i")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

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

g = A("g")
m = B("m")
k = C("k")
j = D("j")
h = E("h")
i = F("i")

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