class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.z: A = None
        self.v: A = None
        self.r: D = None
        self.s: D = None
        self.t: D = None
        self.txt = txt

m = A("m")
l = B("l")
c = C("c")
h = D("h")
d = E("d")
b = F("b")
e = G("e")
g = B("g")

m.u = c
l.y = c
l.r = c
l.s = c
l.v = m
l.z = m
l.o = g
l.x = d
c.r = b
c.s = h
h.r = c
h.s = b
h.o = m
h.v = d
d.y = c
b.t = d
b.o = l
b.p = h
e.u = b
e.w = h
e.r = h
e.s = h
e.t = h
e.z = m
e.v = m
g.y = c
g.r = c
g.s = c
g.v = m
g.z = m
g.o = l
g.x = d
assert h.v.y.r.t.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.z: A = None
        self.v: A = None
        self.r: D = None
        self.s: D = None
        self.t: D = None
        self.txt = txt

m = A("m")
l = B("l")
c = C("c")
h = D("h")
d = E("d")
b = F("b")
e = G("e")
g = B("g")

m.u = c
l.y = c
l.r = c
l.s = c
l.v = m
l.z = m
l.o = g
l.x = d
c.r = b
c.s = h
h.r = c
h.s = b
h.o = m
h.v = d
d.y = c
b.t = d
b.o = l
b.p = h
e.u = b
e.w = h
e.r = h
e.s = h
e.t = h
e.z = m
e.v = m
g.y = c
g.r = c
g.s = c
g.v = m
g.z = m
g.o = l
g.x = d
assert h.v.y.r.t.y.r.txt == "b"