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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: D = None
        self.q: E = None
        self.x: F = None
        self.v: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: D = None
        self.q: E = None
        self.x: F = None
        self.v: A = None
        self.txt = txt

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

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

b.t = l
b.p = l
b.o = g
g.p = i
g.s = i
g.t = c
e.t = c
e.p = h
n.t = k
n.r = i
n.o = i
n.x = e
l.r = i
l.t = i
l.p = g
l.u = g
c.t = b
c.v = b
c.p = n
c.q = l
c.x = h
i.y = k
i.r = b
i.p = g
h.t = b
h.v = b
h.p = n
h.q = l
h.x = c
k.t = n
k.r = i
k.o = i
k.x = e
assert c.p.t.r.r.txt == "b"