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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.v: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: G = None
        self.r: E = None
        self.y: A = None
        self.t: A = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: G = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.v: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: G = None
        self.r: E = None
        self.y: A = None
        self.t: A = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: G = None
        self.v: F = None
        self.txt = txt

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

g.p = c
g.o = f
g.y = b
f.s = b
f.x = l
f.v = g
f.q = c
b.y = h
b.v = h
b.z = c
c.p = b
c.z = h
c.r = i
c.y = g
c.t = g
c.q = g
i.y = k
i.t = k
m.x = i
l.r = f
l.z = h
l.v = m
h.r = f
h.z = l
h.v = m
k.x = i
assert i.t.x.y.x.t.x.txt == "i"